package com.itc.dispatch.controller;

import com.itc.common.core.domain.R;
import com.itc.common.core.validate.Add;
import com.itc.dispatch.domain.FlightRecordLimit;
import com.itc.dispatch.service.FlightRecordLimitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/flight/record/limit")
@Api(value = "flightRecordLimit", tags = "航班运行限制录入管理模块")
public class FlightRecordLimitController {

    @Autowired
    private FlightRecordLimitService flightRecordLimitService;

    /**
     * 录入数据查询
     * @return
     */
    @ApiOperation(value = "录入数据查询")
    @PostMapping("/list")
    public R<FlightRecordLimit> getList(@RequestBody FlightRecordLimit dto){
        return flightRecordLimitService.getList(dto);
    }

    /**
     * 录入数据保存
     * @return
     */
    @ApiOperation(value = "录入数据保存")
    @PostMapping("/save")
    public R saveData(@RequestBody @Validated(Add.class) FlightRecordLimit dto){
        return flightRecordLimitService.saveData(dto);
    }





}
